<?php
/**
 * View parcial para campo form admin
 * @param campo
 * @param cabecalho
 * @param valor
 * @param required
 */
$campo = $this->campo;
$cabecalho = $this->cabecalho;
$valor = $this->valor;
$hint = $this->hint;
$wysiwyg = ($this->wysiwyg === false) ? 0 : 1;
?>
<script type="text/javascript">
$(function(){
	var wysiwyg = '<?php echo $wysiwyg;?>';
	var textarea = $('textarea #<?php echo $campo;?>');
	textarea.addClass('wysiwyg');
	if (wysiwyg == '0') {
		textarea.removeClass('wysiwyg');
	}
	else {
		if (typeof options == 'undefined') {
			options = {};
		}
		$("#<?php echo $campo; ?>").wysiwyg(options);
	}
});
</script>
<label for="<?php echo $campo; ?>"><?php echo $cabecalho; ?></label>
<textarea style="height: 200px;" class="text-input large-input wysiwyg {validate: {required: <?php echo (isset($this->required) && $this->required == false) ? 'false' : 'true'; ?>}}" id="<?php echo $campo; ?>" name="<?php echo $campo; ?>"><?php echo $valor; ?></textarea>
<?php 
if(!empty($hint)){
?>
<small class="hint"><?php echo $hint; ?></small>
<?php 
}
?>